<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>notify-rule-view</title>
   
	<%@ include file="../include/common.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/iframe.js"></script>
    <link href="${pageContext.request.contextPath}/style/default/form/ui.tabs.css" type="text/css" rel="stylesheet" media="print, projection, screen"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/form/ui.tabs.js"></script>
	<script src="${pageContext.request.contextPath}/js/crontab/Simple_util.js"></script>
    <script src="${pageContext.request.contextPath}/js/TimeUnit/TimeUnit.js"></script>
    <script src="${pageContext.request.contextPath}/js/TimeUnit/TimeUnit_data_zh_CN.js"></script>
	<script type="text/javascript">
		var stu;
		
		  $(function(){
			  var windowHeight = getWindowHeight()-84;
			  $("iframe").css("height",windowHeight+'px');
			  
			  if('${radio}' == 'all'){
				  $("#radios1").attr("checked","checked");
			  }else{
				  $("#radios2").attr("checked","checked");
			  }
			 
			  var eventLevels = '${notifyRule.eventLevels}'.split(',');
			  for(var i= 0 ; i< eventLevels.length;i++){
				  if(eventLevels[i] == '2'){
					  var str=document.getElementById("eventLevels1");
						str.checked = true;
				  }
					if(eventLevels[i] == '3'){
						 var str=document.getElementById("eventLevels2");
							str.checked = true;			  
									  }
					if(eventLevels[i] == '4'){
						 var str=document.getElementById("eventLevels3");
							str.checked = true;
					}
					if(eventLevels[i] == '5'){
						 var str=document.getElementById("eventLevels4");
							str.checked = true;
					}
					if(eventLevels[i] == '1'){
						 var str=document.getElementById("eventLevels5");
							str.checked = true;
					}
			  }
			 
			  $('#container-1').fadeIn("fast"); 
				$('#container-1 ul').tabs({
					show: function() {
						var li_index = $('#container-1 ul').tabsSelected();
					}
			  });
		  });
		  function closewin(){
			  window.history.back();
		  }
		  function show(){
				$("#views").css({"top":$("#show").offset().top+12+"px", "left":$("#show").offset().left+"px", "visibility":"visible"})
		  }
		  function closed(){
				$("#views").css({"visibility":"hidden"})
			}
		 
	</script>

  </head>
  
  <body>
  
  		<h2 class="title-h2"><span><img src="${pageContext.request.contextPath}/style/default/bsm/images/arrow-down.gif"/></span>查看事件通知</h2>
   		<div id="menuContent" style="display:none; position: absolute;z-index:100;">
			<ul id="treeDemo" class="ztree" style="margin-top:0; width:200px; height: 200px;"></ul>
		</div>
   		<div id="container-1" style="display:none">
			<ul>
				<li><a href="#fragment-1"><span>基本信息</span></a></li>
				<li><a href="#fragment-3"><span>通知接收者</span></a></li>
				<li><a href="#fragment-4"><span>通知延迟</span></a></li>
				<li><a href="#fragment-5"><span>通知暂停</span></a></li>
				<li><a href="#fragment-6"><span>子资源过滤</span></a></li>
			</ul>
			<div id="fragment-1">
				<div id="views" style="position:absolute; visibility:hidden;border:2px solid #CCC;background-color:white;">
					<c:forEach items="${eventTypeName}" var="etn" varStatus="status">
							${etn}<br />	
					</c:forEach>
				</div>
				<form action="" id="myform" name="myform" method="post">
					<table class="table_eidt">
			  			<tr style="height: 60px">
				    		<td class="td_left" width="120px">
								资源名称
				    		</td>
				    		<td class="td_right">
				    			${resName}
				    			<input type="hidden" id="resId" name="resId" value='${resId}'>
				    		</td>
			    		</tr>
			    		<tr style="height: 50px"  id="durationTd">
			    			<td class="td_left">持续时间</td>
			    			<td class="tdValue">
			    				${duration}
			    			</td>
		    			</tr>
			    		<tr style="height: 60px">
				    		<td class="td_left">
								<span class="span_alert">*</span>事件级别
				    		</td>
				    		<td class="td_right">
				    		  <input type="checkbox" name="eventLevels" id="eventLevels1"  value="2" disabled="disabled"><font color='#C8FF00'>轻微</font>
					          <input type="checkbox" name="eventLevels" id="eventLevels2" value="3" disabled="disabled"><font color='#FFD200'>警告</font>
					          <input type="checkbox" name="eventLevels" id="eventLevels3" value="4" disabled="disabled"><font color='#FF9200'>重要</font>
					          <input type="checkbox" name="eventLevels" id="eventLevels4" value="5" disabled="disabled"><font color='#FF1042'>严重</font>
					          <input type="checkbox" name="eventLevels" id="eventLevels5" value="1" disabled="disabled"><font color='black'>恢复</font>
				    		</td>
			    		</tr>
			    		<tr style="height: 60px">
				    		<td class="td_left">
								<span class="span_alert">*</span>规则名称
				    		</td>
				    		<td class="td_right">
				    			${notifyRule.name}
				    			<span id="nameTip" style="width:150px"></span>
				    		</td>
			    		</tr>
			    		<tr style="height: 60px">
				    		<td class="td_left">
								事件类别
				    		</td>
				    		<td class="td_right">
				    			<input type="radio" name="radios" id="radios1" onclick="clearEventType();" disabled="disabled">全选&nbsp;&nbsp;
    							<input name="radios" id="radios2" type="radio" onclick="showEventTypeTree();" disabled="disabled"><span onmouseover="show();" onmouseout="closed();" id="show">自定义</span>
				    			<input type="hidden" id="eventTypeId" name="eventTypeId" value='${eventType}'>
				    		</td>
			    		</tr>
			  		</table>
			  		<div align="left" style="margin-top:5px;">
				    	<input type="button" value="返回" onclick="closewin();" class="btn-4">
		    		</div>
		    		<input id="id" name="id" type="hidden" value=${notifyRule.id}>
				</form>
			</div>
			<div id="fragment-3">
				<iframe style="width: 100%;" src="${pageContext.request.contextPath}/jsp/notify/notify-receive-rule-view.jsp" frameborder="0"></iframe>
			</div>
			<div id="fragment-4">
				<iframe style="width: 100%;" src="${pageContext.request.contextPath}/jsp/notify/notify-delay-rule-view.jsp" frameborder="0"></iframe>
			</div>
			<div id="fragment-5">
				<iframe style="width: 100%;" src="${pageContext.request.contextPath}/jsp/notify/notify-pause-rule-view.jsp" frameborder="0"></iframe>
			</div>
			<div id="fragment-6">
				<iframe style="width: 100%;" src="${pageContext.request.contextPath}/jsp/notify/notify-exclude-res-view.jsp" frameborder="0"></iframe>
			</div>
		</div>
    </body>
</html>
